{include file="public/header"}
<title xmlns="http://www.w3.org/1999/html">详情</title>
<script type="text/javascript" src="{$Think.DOMAIN_SRC}/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="{$Think.DOMAIN_SRC}/static/h-ui.admin/js/CH-ui.js"></script>
</head>

<style>
    h2 {
        padding: 0;
        margin: 0;
    }
</style>
<body>
<article class="page-container">
    <form action="" method="post" class="form form-horizontal ch-info" id="form-member-add">
        <?php if(empty($cos['time'])){ ?>
        <div class="flex2"><a data-id="{$data.order_id}" class="cost ch-addd" href="javascript:;" title="核算成本">核算成本</a>
        </div>
        <?php } ?>
        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>订单信息</h2>
        <div class="ch-info-row"><label>渠道：</label>
            <p>{$data.title}</p></div>

        {if condition="$data.channel_title"}
        <div class="ch-info-row"><label>二级渠道：</label>
            <p>{$data.channel_title}</p></div>
        {/if}
        <div class="ch-info-row">
            <label>问题：</label>
            <p>
                <span>{$data['pro_id']}</span>
                <span>{$data['pro_id1']}</span>
                <span>{$data['pro_id2']}</span>
            </p>
        </div>
        <div class="ch-info-row">
            <label>地址：</label>
            <p>
                <span>{$data['province']}</span>
                <span>{$data['city']}</span>
                <span>{$data['county']}</span>
                <span>{$data['addres']}</span>
            </p>
        </div>
        <div class="ch-info-row"><label>联系人：</label>
            <p>{$data.contacts}</p></div>
        {if condition="$hide == 2"}
        <div class="ch-info-row"><label>联系电话：</label>
            <p>{$data.telephone}</p></div>
        {/if}
        <div class="ch-info-row"><label>下单时间：</label>
            <p>{:date('Y-m-d H:i:s',$data.created_time)}</p></div>
        <div class="ch-info-row"><label>备注：</label>
            <p>{$data.remarks}</p></div>
        {if condition="$data.state != 0"}
        <div class="ch-info-row"><label>指派店长：</label>
            <p>{$data.username}</p></div>
        {if condition="$data.planned"}
        <div class="ch-info-row"><label>预计上门时间：</label>
            <p><?php if(!empty($data['planned'])){?> {:date('Y-m-d H:i:s',$data.planned)}  <?php } ?></p></div>
        {/if}
        {/if}
        <div class="ch-info-row">
            <label>状态：</label>
            <p>
                <span style="color: red">{$data.states}</span>
            </p>

        </div>
        {if condition="$data.state == 8"}
        <div class="ch-info-row">
            <label>取消原因：</label>
            <p>{$data.reason}</p>
        </div>
        <div class="ch-info-row">
            <label>时间：</label>
            <p><?php if(!empty($data['tui_time'])){?> {:date('Y-m-d H:i:s',$data.tui_time)}  <?php } ?></p>
        </div>
        {/if}

        {if condition="$data.state == 9"}
        <div class="ch-info-row">
            <label>退单原因：</label>
            <p>{$data.reason}</p>
        </div>
        <div class="ch-info-row">
            <label>时间：</label>
            <p><?php if(!empty($data['tui_time'])){?> {:date('Y-m-d H:i:s',$data.tui_time)}  <?php } ?></p>
        </div>
        <div class="ch-info-row">
            <label>退单金额：</label>
            <p>{$data.tui_moey}</p>
        </div>
        <div class="ch-info-row">
            <label>退单状态：</label>
            <p>
                <?php if($data['tui_state']==1){?> 审核中  <?php }elseif($data['tui_state']==2){ ?>
                已通过
                <?php }?>
            </p>
        </div>
        <div class="ch-info-row">
            <label>备注：</label>
            <p>{$data.tui_shen}</p>
        </div>
        {/if}
        <div class="ch-info-row">
            <label>所属物业：</label>
            <p>{$data.content1}</p>
        </div>
        <div class="ch-info-row">
            <label>推荐人：</label>
            <p>{$data.management}</p>
        </div>
        <div class="ch-info-row">
            <label>图片：</label>
            <p>
                <?php if(is_array($data['logo'])) foreach($data['logo'] as $user){ ?>
                <img style="width: 100px;height: 100px;margin-right: 15px" src="<?php echo $user ?>">
                <?php } ?>
            </p>
        </div>

        {if condition="$complaint"}
        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>订单投诉</h2>
        <div class="ch-info-row ch-row-label"><label>投诉店长：</label>
            <p>{$complaint.shopowner}</p></div>
        <div class="ch-info-row ch-row-label"><label>原因：</label>
            <p>{$complaint.reason}</p></div>
        <div class="ch-info-row ch-row-label"><label>备注：</label>
            <p>{$complaint.requirement}</p></div>
        <div class="ch-info-row ch-row-label"><label>时间：</label>
            <p> <?php if(!empty($complaint['create_time'])){ echo date('Y-m-d H:i:s',$complaint['create_time']); } ?></p>
        </div>
        <div class="ch-info-row ch-row-label"><label>登记人：</label>
            <p>{$complaint.admins}</p>
        </div>
        {/if}

        <?php if(!empty($through)){?>
        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>远程沟通</h2>
        <a data-id="{$data.order_id}" data-type="1" class="gen ch-add" href="javascript:;" title="新增">新增</a>
        <div class="title-border">
            <div class="flex2">方式</div>
            <div class="flex3 screen-phone">跟进时间</div>
            <div class="flex3 screen-phone">下次跟进时间</div>
            <div class="flex2 screen-phone">跟进客服</div>
            <div class="flex2">跟进状态</div>
            <div class="flex2 screen-phone">跟进内容</div>
            <div class="flex2 screen-phone">跟进内容</div>
            <div class="flex1">转派</div>
            <div class="flex5 screen-phone">内容</div>
            <div class="flex5 screen-phone">图片</div>
            <!--<div class="flex2 screen-phone">订单信息</div>-->
            <!--<div class="flex2 screen-phone">报价记录</div>-->

            <div class="flex2">操作</div>
        </div>
        {volist name='through' id='vo'}
        <div class="content-border">
            <div class="flex2">{$vo.mode}</div>
            <div class="flex3 screen-phone"><?php echo date('Y-m-d H:i:s',$vo['th_time']) ?></div>
            <div class="flex3 screen-phone"><?php if(!empty($vo['end_time'])){ echo date('Y-m-d H:i:s',$vo['end_time']); } ?></div>
            <div class="flex2 screen-phone"><?php if($vo['role']==1){   ?> <span
                    style="color: red">客服-{$vo.admin_id}</span> <?php }elseif($vo['role']==2){  ?><span
                    style="color:blue">店长-{$vo.admin_id}</span> <?php }elseif($vo['role']==3){  ?><span
                    style="color:blue">工人:{$vo.gid}<?php }elseif($vo['role']==4){  ?><span style="color:blue">客户</span></span><?php } ?>
            </div>
            <div class="flex2">{$vo.status}</div>
            <div class="flex2 screen-phone">{$vo.status1}</div>
            <div class="flex2 screen-phone">{$vo.status2}</div>
            <div class="flex1"><?php if($vo['single']==1){   ?> <span style="color: red">是</span> <?php }else{  ?><span
                    style="color:blue">否</span><?php } ?></div>
            <div class="flex5 screen-phone">{$vo.remar}</div>
            <div class="flex5 screen-phone"><p><?php if(is_array($vo['log'])) foreach($vo['log'] as $user){ ?>
                <img style="width: 100px;height: 100px;margin-right: 15px" src="<?php echo $user ?>">
                <?php } ?></p></div>
            <!--<div class="flex2">{$vo.amount}</div>-->
            <!--<div class="flex2 screen-phone"><?php if($vo['baocun']==1){   ?> <span-->
            <!--style="color: red">成交</span> <?php }else{  ?>保存记录 <?php } ?></div>-->
            <!--<?php if($vo['baocun']==1 || !empty($vo['capital_id'])){   ?>-->
            <!--<div class="flex2 screen-phone"><a class="ch-button ch-blue bao" data-id="{$vo.through_id}"-->
            <!--data-state="{$data['state']}" href="javascript:;" title="查看记录">查看记录</a>-->
            <!--</div>-->
            <!--<?php }else{  ?>-->
            <!--<div class="flex2 screen-phone">暂无记录</div>-->
            <!--<?php } ?>-->
            <div class="flex2 screen-pc"><a href="javascript:;" class="ch-button ch-blue more">全部</a></div>
            <div class="flex2 screen-phone"><a class="ch-button ch-blue through" data-id="{$vo.through_id}"
                                               data-type="1" href="javascript:;" title="编辑">编辑</a></div>
        </div>
        {/volist}
        <div class="pages" style="float: right">{$through->render()}</div>
        <?php }?>

        <?php if(!empty($through1)){?>
        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>远程沟通报价</h2>
        <!--<?php if($data['state'] <3 ){ ?>-->
        <!--<a data-id="{$data.order_id}" data-type="2" class="gen ch-add" href="javascript:;" title="新增">新增</a>-->
        <!--<?php } ?>-->

        <div class="title-border">
            <div class="flex1">方式</div>
            <div class="flex3 screen-phone">跟进时间</div>
            <div class="flex3 screen-phone">下次跟进时间</div>
            <div class="flex2 screen-phone">跟进人员</div>

            <div class="flex5 screen-phone">内容</div>
            <div class="flex2">金额</div>
            <div class="flex2 screen-phone">订单信息</div>
            <div class="flex2 screen-phone">报价记录</div>

            <div class="flex2">操作</div>
        </div>
        {volist name='through1' id='vo'}
        <div class="content-border">
            <div class="flex1">{$vo.mode}</div>
            <div class="flex3 screen-phone"><?php echo date('Y-m-d H:i:s',$vo['th_time']) ?></div>
            <div class="flex3 screen-phone"><?php if(!empty($vo['end_time'])){ echo date('Y-m-d H:i:s',$vo['end_time']); } ?></div>
            <div class="flex2 screen-phone"><?php if($vo['role']==1){   ?> <span
                    style="color: red">客服-{$vo.admin_id}</span> <?php }elseif($vo['role']==2){  ?><span
                    style="color:blue">店长-{$vo.admin_id}</span> <?php }elseif($vo['role']==3){  ?><span
                    style="color:blue">工人:{$vo.gid}<?php }elseif($vo['role']==4){  ?><span style="color:blue">客户</span></span><?php } ?>
            </div>
            <div class="flex5 screen-phone">{$vo.remar}</div>
            <div class="flex2">{$vo['amount']-$c}</div>
            <div class="flex2 screen-phone"><?php if($vo['baocun']==1){   ?> <span
                    style="color: red">成交</span> <?php }else{  ?>保存记录 <?php } ?></div>
            <?php if($vo['baocun']==1 || !empty($vo['capital_id'])){   ?>
            <div class="flex2 screen-phone"><a class="ch-button ch-blue bao" data-id="{$vo.through_id}"
                                               data-state="{$data['state']}" href="javascript:;" title="查看记录">查看记录</a>
            </div>
            <?php }else{  ?>
            <div class="flex2 screen-phone">暂无记录</div>
            <?php } ?>
            <div class="flex2 screen-pc"><a href="javascript:;" class="ch-button ch-blue more">全部</a></div>
            <div class="flex2 screen-phone"><a class="ch-button ch-blue through" data-id="{$vo.through_id}"
                                               data-type="2" href="javascript:;" title="编辑">编辑</a></div>
        </div>
        {/volist}
        <div class="pages" style="float: right">{$through->render()}</div>
        <?php }?>
        {if condition="$cos.time"}
        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>成本核算</h2>
        <div class="ch-info-row ch-row-label"><label>是否合算：</label>
            <?php if($cos['type']==1){ ?> <p>是</p> <?php }else{?> <p>否</p><?php }?></div>
        <div class="ch-info-row ch-row-label"><label>备注：</label>
            <p>{$cos.content}</p></div>
        <div class="ch-info-row ch-row-label"><label>时间：</label>
            <p> <?php if(!empty($cos['time'])){ echo date('Y-m-d H:i:s',$cos['time']); } ?></p>
        </div>
        <div class="ch-info-row ch-row-label"><label>登记人：</label>
            <p>{$cos.username}</p>
        </div>
        {/if}

        <br>
        <?php if($data['state'] !=0  && $data['state'] !=1 && $data['state'] !=2 ){ ?>
        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>基检信息</h2>
        {if condition="$data.ok==1"}
        <!--<?php if($data['state'] >2 ){ ?>-->
        <!--<a class="ch-add zeng" data-id="{$data.order_id}" data-key="{$data.ok}" href="javascript:;" title="增项">增项</a>-->
        <!--<?php } ?>-->

        <!--<a style="text-decoration:none" data-id="{$data.order_id}" class="ertao"  href="javascript:;" title="查看方案"><span class="label label-primary">查看方案</span></a>-->
        <p>问题：<span style="color: red"><?php if(!empty($data['wen_a'])){?> {$data['wen_a']}  <?php } ?></span></p>
        <div class="title-border screen-phone">
            <div class="flex1">分类</div>
            <div class="flex2">名称</div>
            <div class="flex1">方量</div>
            <div class="flex1">价格</div>

            <div class="flex1">质保</div>
            <div class="flex3">基建时间</div>

            <div class="flex1">总金额</div>

        </div>
        {volist name='capital' id='vo' key='i'}
        <div class="content-border screen-phone">
            <div class="flex1">{$vo.class_a}</div>
            <div class="flex2">{$vo.class_b}</div>
            <div class="flex1">{$vo.square}/{$vo.company}</div>
            <div class="flex1">{$vo.un_Price}</div>
            <div class="flex1"><?php if($vo['zhi'] ==1){ ?>是<?php }else{ ?>否<?php }?></div>
            <div class="flex3">{:date('Y-m-d H:i:s',$vo.crtime)}</div>
            <div class="flex1">{$vo.to_price}</div>

        </div>
        {/volist}

        <div class="ch-column-over screen-pc">
            <div class="ch-column-track">
                <div class="ch-column-row">
                    <div class="ch-column-title">分类</div>
                    <div class="ch-column-text">
                        {volist name='capital' id='vo' key='i'}
                        <div class="ch-column-content ch-column-num">
                            {$vo.class_a}
                        </div>
                        {/volist}
                    </div>
                </div>
                <div class="ch-column-row">
                    <div class="ch-column-title">名称</div>
                    <div class="ch-column-text">
                        {volist name='capital' id='vo' key='i'}
                        <div class="ch-column-content">
                            {$vo.class_b}
                        </div>
                        {/volist}
                    </div>
                </div>
                <div class="ch-column-row">
                    <div class="ch-column-title">方量</div>
                    <div class="ch-column-text">
                        {volist name='capital' id='vo' key='i'}
                        <div class="ch-column-content">
                            {$vo.square}/{$vo.company}
                        </div>
                        {/volist}
                    </div>
                </div>
                <div class="ch-column-row">
                    <div class="ch-column-title">价格</div>
                    <div class="ch-column-text">
                        {volist name='capital' id='vo' key='i'}
                        <div class="ch-column-content">
                            {$vo.un_Price}
                        </div>
                        {/volist}
                    </div>
                </div>

                <div class="ch-column-row">
                    <div class="ch-column-title">质保</div>
                    <div class="ch-column-text">
                        {volist name='capital' id='vo' key='i'}
                        <div class="ch-column-content">
                            <?php if($vo['zhi'] ==1){ ?>是<?php }else{ ?>否<?php }?>
                        </div>
                        {/volist}
                    </div>
                </div>
                <div class="ch-column-row">
                    <div class="ch-column-title">基建时间</div>
                    <div class="ch-column-text">
                        {volist name='capital' id='vo' key='i'}
                        <div class="ch-column-content">
                            {:date('Y-m-d H:i:s',$vo.crtime)}
                        </div>
                        {/volist}
                    </div>
                </div>
                <div class="ch-column-row">
                    <div class="ch-column-title">总金额</div>
                    <div class="ch-column-text">
                        {volist name='capital' id='vo' key='i'}
                        <div class="ch-column-content">
                            {$vo.to_price}
                        </div>
                        {/volist}
                    </div>
                </div>

            </div>
        </div>
        {if condition="$c || $give_d || $gong"}
        <!--{if condition="$data['state'] !=6 && $data['state'] !=7 "}-->
        <!--<div class="ch-row ch-info-form" style="margin-top: 20px;">-->
        <!--<div class="flex2 ch-row" style="line-height: initial;"><a class="ch-button ch-gray gong" data-id="{$data.order_id}" href="javascript:;" title="修改">修改</a></div>-->
        <!--</div>-->
        <!--{/if}-->
        <div class="ch-row ch-info-form">
            <div class="flex1">优惠总金额：</div>
            <div class="flex2"><span style="color: red">¥：{$c}</span></div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">项目管理费：</div>
            <div class="flex2"><span style="color: red">¥：{$expense}</span></div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">赠送项目：</div>
            <div class="flex2"><span style="color: red">{$give_d}</span></div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">施工天数：</div>
            <div class="flex2"><span style="color: red">{$gong}</span></div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">图片：</div>
            <div class="flex2">
                <?php if(is_array($capitalgo)) foreach($capitalgo as $user){ ?>
                <img style="width:8%;" src="<?php echo $user ?>">
                <?php } ?>
            </div>
        </div>
        <div class="ch-row ch-info-form">
            <div class="flex1">备注：</div>
            <div class="flex2"><span style="color: red">{$give_remarks}</span></div>
        </div>
        {/if}
        {/if}

        <?php if(!empty($data['label_id'])){ ?>

        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>重点标签</h2>
        <div class="ch-info-row ch-row-label"><label>标签：</label>
            <p>{volist name='label' id='vo'}<span>{$vo.content}</span>{/volist}</p></div>
        <div class="ch-info-row ch-row-label"><label>备注：</label>
            <p>{$data.inside}</p></div>
        <?php } ?>

        <?php }?>
        <?php if($data['state'] !=0  && $data['state'] !=1 && $data['state'] !=2 && $data['state'] !=3 ){ ?>

        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>签约信息
            <!--<?php if($data['online'] == 2){ ?>-->
            <!--<span class="ch-info-c-title">线上签约</span>-->
            <!--<?php }else{ ?>-->
            <!--<span class="ch-info-c-title">线下签约</span>-->
            <!--<?php } ?>-->
        </h2>
        {if condition="$data.dep_money >0 "}
        <div class="ch-info-row">
            <label>收款：</label>
            <p> {$data.dep_money}</p>
        </div>
        {/if}

        {if condition="$data.contracType ==1 "}
        <div class="ch-info-row">
            <label>签约合同：</label>
            <div class="ch-row-img">
                <?php if(is_array($data['contract'])) foreach($data['contract'] as $user){ ?>
                <img style="width: 100px;height: 100px;" src="<?php echo $user ?>">
                <?php } ?>
            </div>
        </div>
        {if condition="$data.order_agency==1"}
        <div class="ch-info-row">
            <label>代购主材合同：</label>
            <div class="ch-row-img">
                <?php if(is_array($data['contract'])) foreach($data['contract'] as $user){ ?>
                <img style="width: 100px;height: 100px;" src="<?php echo $user ?>">
                <?php } ?>
            </div>
        </div>
        {/if}
        <div class="ch-info-row">
            <label>定金发票：</label>
            <div class="ch-row-img">
                <?php if(is_array($data['deposit']))foreach($data['deposit'] as $user){ ?>
                <img style="width: 100px;height: 100px;" src="<?php echo $user ?>">
                <?php } ?>
            </div>
        </div>
        {else}
        <div class="ch-info-row">
            <label>签约合同：</label>
            <p><a href="<?php echo $sign['contractpath'] ?>" target=_blank>查看合同</a></p>

        </div>
        {if condition="$data.order_agency==1"}
        <div class="ch-info-row">
            <label>代购主材合同：</label>
            <div class="ch-row-img">
                <p><a href="<?php echo $sign['agency_img'] ?>" target=_blank>查看合同</a></p>
            </div>
        </div>
        {/if}
        <div class="ch-info-row">
            <label>签约时间：</label>
            <p><?php if(!empty($data['con_time'])){?> {:date('Y-m-d H:i:s',$data.con_time)}  <?php } ?></p>
        </div>
        {/if}

        <?php if($data['state'] >= 4 ){ ?>
     

        <?php if($data['state'] ==6 || $data['state']==7){ ?>

        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>订单信息费用</h2>
        <div class="ch-info-row"><label>实际完工时间：</label>
            <p><?php if(!empty($data['uptimes'])){?> {:date('Y-m-d H:i:s',$data.uptimes)}  <?php } ?></p></div>
        <div class="ch-info-row"><label>总人工时长：</label>
            <p>{$data.shichang}</p></div>
        <div class="ch-info-row"><label>实际收款：</label>
            <p>{$data.total}</p></div>
        <div class="ch-info-row"><label>实际总价：</label>
            <p>{$data.totalprice}</p></div>
        <!--<div class="ch-info-row"><label>优惠价：</label>-->
        <!--<p>{$data.discount}</p></div>-->
        <!--<div class="ch-info-row">-->
        <!--<label>图片：</label>-->
        <!--<div class="ch-row-img">-->
        <!--<?php if(is_array($data['logos']))foreach($data['logos'] as $user){ ?>-->
        <!--<img style="width: 100px;height: 100px;" src="<?php echo $user ?>">-->
        <!--<?php } ?>-->
        <!--</div>-->
        <!--</div>-->
        <!--<div class="row cl">-->
        <!--<label class="form-label col-xs-4 col-sm-3">人工成本：</label>-->
        <!--<div class="formControls col-xs-8 col-sm-9">-->
        <!--{$data.artificial}-->
        <!--</div>-->
        <!--</div>-->
        <!--<div class="row cl">-->
        <!--<label class="form-label col-xs-4 col-sm-3">材料成本：</label>-->
        <!--<div class="formControls col-xs-8 col-sm-9">-->
        <!--{$data.material}-->
        <!--</div>-->
        <!--</div>-->
        <?php }?>
        <?php if($data['state']==7){ ?>
        {if condition="$data.kupj != 0"}
        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>客户评价</h2>

        <div class="ch-info-row"><label>施工满意度：</label>
            <p>{$data.score}分</p></div>
        <div class="ch-info-row">
            <label>店长服务态度：</label>
            <p>
                {if condition="$data.score2 == 1"}
                1分 不满意
                {elseif condition="$data.score2 == 2"}
                2分 一般
                {elseif condition="$data.score2 == 3"}
                3分 还行
                {elseif condition="$data.score2 == 4"}
                4分 满意
                {elseif condition="$data.score2 == 5"}
                5分 非常满意
                {/if}
            </p>
        </div>
        <div class="ch-info-row">
            <label>客服服务态度：</label>
            <p>
                {if condition="$data.score3 == 1"}
                1分 不满意
                {elseif condition="$data.score3 == 2"}
                2分 一般
                {elseif condition="$data.score3 == 3"}
                3分 还行
                {elseif condition="$data.score3 == 4"}
                4分 满意
                {elseif condition="$data.score3 == 5"}
                5分 非常满意
                {/if}
            </p>
        </div>
        <div class="ch-info-row"><label>反馈信息：</label>
            <p>{$data.content}</p></div>
        <div class="ch-info-row">
            <label>图片：</label>
            <div class="ch-row-img">
                <?php if(is_array($data['tupian'])) foreach($data['tupian'] as $user){ ?>
                <img style="width: 100px;height: 100px;" src="<?php echo $user ?>">
                <?php } ?>
            </div>
        </div>
        <div class="ch-info-row"><label>评论人：</label>
            <p>{$data.customers_id}</p></div>
        <div class="ch-info-row"><label>评论时间：</label>
            <p><?php if(!empty($data['uptime'])){?> {:date('Y-m-d H:i:s',$data.uptime)}  <?php } ?></p></div>
        {/if}
        {if condition="$data.product"}
        <h2 class="ch-info-title"><span class="glyphicon glyphicon-file"></span>订单评价信息</h2>
        {volist name='data["product"]' id='vo'}
        <div class="ch-info-row"><label>打分：</label>
            <p>{$vo.score}</p></div>
        <div class="ch-info-row"><label>介绍意愿度：</label>
            <p>{$vo.full}</p></div>
        <div class="ch-info-row"><label>反馈信息：</label>
            <p>{$vo.content}</p></div>
        <div class="ch-info-row"><label>哪些服务不满意：</label>
            <p>{$vo.dissatisfied}</p></div>
        <div class="ch-info-row"><label>体验最好的地方：</label>
            <p>{$vo.best}</p></div>
        <div class="ch-info-row"><label>电话是否接通：</label>
            <p>{$vo.connect}</p></div>
        <div class="ch-info-row"><label>回访人：</label>
            <p>{$vo.people}</p></div>
        <div class="ch-info-row"><label>回访时间：</label>
            <p><?php if(!empty($data['uptime'])){?> {:date('Y-m-d H:i:s',$vo.uptime)}  <?php } ?></p></div>
        {/volist}
        {/if}
        <?php }?>
        <?php }?>
        <?php }?>
    </form>
    <div class="ch-more">
        <div class="ch-more-box">
            <div class="ch-more-top">
                <div class="ch-more-off"></div>
            </div>
            <div class="ch-more-tark">
                <div class="ch-more-content">

                </div>
            </div>
        </div>
    </div>
</article>

{include file="public/footer"}
<script>
    $(function () {
        var columnTitle = ($(window).width() - 30) * 0.3;
        var columnContent = ($(window).width() - 30) * 0.7;
        $(".ch-column-track").css({
            "width": columnTitle + (columnContent * $(".ch-column-num").length) + 'px',
            "padding-left": columnTitle,
        });
        $(".ch-column-title").css("width", columnTitle);
        $(".ch-column-content").css("width", columnContent);
        for (var i = 0; i < $(".ch-column-title").length; i++) {
            $(".ch-column-title").eq(i).css("height", $(".ch-column-text").eq(i).height())
        }
    })
</script>
<script>
    jQuery.fn.rowspan = function (colIdx) { //封装的一个JQuery小插件
        return this.each(function () {
            var that;
            $('tr', this).each(function (row) {
                $('td:eq(' + colIdx + ')', this).filter(':visible').each(function (col) {
                    if (that != null && $(this).html() == $(that).html()) {
                        rowspan = $(that).attr("rowSpan");
                        if (rowspan == undefined) {
                            $(that).attr("rowSpan", 1);
                            rowspan = $(that).attr("rowSpan");
                        }
                        rowspan = Number(rowspan) + 1;
                        $(that).attr("rowSpan", rowspan);
                        $(this).hide();
                    } else {
                        that = this;
                    }
                });
            });
        });
    }
    /***
     *
     * 通过
     * */
    $('.page-container').on('click', '.tong', function () {
        var id = $(this).attr('data-id');
        var src = "<?php echo UIP_SRC?>/shopowner/Orderstage/passCheckStage";
        layer.confirm('确认通过么', function (index) {
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data: {
                    stage_id: id,
                    role: 2,
                    order_num: '{$data.order_no}',
                },
                success: function (data) {
                    if (data.code == 200) {
                        layer.msg(data.msg, {icon: 1, time: 2000}, function () {
                            setTimeout("window.location.reload()", 1);
                        });
                    } else {
                        layer.msg(data.msg, {icon: 5, time: 1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        });
    });
    /**
     * 成本核算
     */
    $('.page-container').on('click', '.cheng', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "800px"
            areaHeight = "600px"
        } else {
            areaWidth = '90%'
            areaHeight = '95%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/cheng')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            scrollbar: true,//屏蔽浏览器滚动条
            shade: 0.4,
            title: '编辑',
            content: src + '?order_id=' + id
        });
    });
    /**
     * 返工
     */
    $('.page-container').on('click', '.fan', function () {
        var id = $(this).attr('data-id');
        var src = "<?php echo UIP_SRC?>/shopowner/Rework/orderRework";
        layer.open({
            id: 1,
            type: 1,
            title: '确认返工原因',
            content: '<div><textarea rows="3" cols="20" class="form-control" style="width: 354px;height: 69px;border: none" id="reason" placeholder="请输入确认返工原因"></textarea></div>',
            btn: ['保存', '取消'],
            btn1: function (index, layero) {
                $.ajax({
                    type: 'POST',
                    url: src,
                    dataType: 'json',
                    data: {
                        type: 4,
                        order_num: '{$data.order_no}',
                        desc: $('#reason').val(),

                    },
                    success: function (data) {

                        if (data.code == 200) {
                            layer.msg(data.msg, {icon: 1, time: 2000}, function () {
                                setTimeout("window.location.reload()", 1);
                            });
                        } else {
                            layer.msg(data.msg, {icon: 5, time: 1000});
                        }

                    },
                    error: function (data) {
                        console.log(data.msg);
                    },
                });

            },
            btn2: function (index, layero) {
                layer.close(index);
            }

        });
    });
    //调用表单的id
    $(function () {
        $("#list").rowspan(10); //传入的参数是对应的列数从0开始，哪一列有相同的内容就输入对应的列数值
        $("#list").rowspan(11);

    });

    if ("{$data['state']}" != 8) {
        $('.qu').css('display', 'none');
        $('.re').css('display', 'none');
        $('.username').css('display', 'none');
    } else if ("{$data['state']}" != 0) {
        $('.username').css('display', 'none');
        $('.qu').css('display', 'black');
        $('.re').css('display', 'black');
    } else {
        $('.username').css('display', 'black')
    }
    /**
     * 基建
     */
    $('.page-container').on('click', '.ji', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "800px"
            areaHeight = "600px"
        } else {
            areaWidth = '90%'
            areaHeight = '95%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/ji')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: true,
            maxmin: true,
            shade: 0.4,
            title: '基检添加',
            content: src + '?type=2&order_id=' + id
        });
    });
    /**
     * 基建
     */
    $('.page-container').on('click', '.bao', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "900px"
            areaHeight = "700px"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var state = $(this).attr('data-state');
        var src = "{:Url('index/order/bao')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: true,
            maxmin: true,
            shade: 0.4,
            title: '查看',
            content: src + '?through_id=' + id + '&state=' + state
        });
    });
    /**
     * 基建
     */
    $('.page-container').on('click', '.through', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "800px"
            areaHeight = "600px"
        } else {
            areaWidth = '100%'
            areaHeight = '100%'
        }
        var id = $(this).attr('data-id');
        var type = $(this).attr('data-type');
        var src = "{:Url('index/order/through')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: true,
            maxmin: true,
            shade: 0.4,
            title: '基检添加',
            content: src + '?through_id=' + id + '&type=' + type
        });
    });
    /**
     * 基建
     */
    $('.page-container').on('click', '.edit1', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "500px";
            areaHeight = "500px";
        } else {
            areaWidth = '100%';
            areaHeight = '100%';
        }

        var id = $(this).attr('data-id');
        var type = $(this).attr('data-key');
        var src = "{:Url('index/order/edit1')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: true,
            maxmin: true,
            shade: 0.4,
            title: '基检编辑',
            content: src + '?order_id=' + id + '&type=' + type
        });
    });
    /**
     * 基建
     */
    $('.page-container').on('click', '.gong', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "800px";
            areaHeight = "600px";
        } else {
            areaWidth = '90%';
            areaHeight = '95%';
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/gong')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: true,
            maxmin: true,
            anim: 1,
            shade: 0.4,
            title: '基检编辑',
            content: src + '?order_id=' + id
        });
    });

    /**
     * 基建
     */
    $('.page-container').on('click', '.zeng', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "800px"
            areaHeight = "600px"
        } else {
            areaWidth = '90%'
            areaHeight = '95%'
        }
        var id = $(this).attr('data-id');
        var type = $(this).attr('data-key');
        var src = "{:Url('index/order/zeng')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            fix: true,
            maxmin: true,
            shade: 0.4,
            title: '增项',
            content: src + '?order_id=' + id + '&type=' + type
        });
    });
    /**
     * 跟进
     */
    $('.page-container').on('click', '.gen', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "800px"
            areaHeight = "600px"
        } else {
            areaWidth = '90%'
            areaHeight = '95%'
        }
        var id = $(this).attr('data-id');
        var type = $(this).attr('data-type');
        var src = "{:Url('index/order/genadd')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            scrollbar: false,//屏蔽浏览器滚动条
            shade: 0.4,
            title: '订单跟进',
            content: src + '?order_id=' + id + '&type=' + type
        });
    });
    /**
     * 核算成本
     */
    $('.page-container').on('click', '.cost', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "700px"
            areaHeight = "400px"
        } else {
            areaWidth = '90%'
            areaHeight = '95%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/cost')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            scrollbar: false,//屏蔽浏览器滚动条
            shade: 0.4,
            title: '核算成本',
            content: src + '?order_id=' + id
        });
    });
    /**
     * 二套
     */
    $('.page-container').on('click', '.ertao', function () {
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/ertao')}";
        layer.open({
            type: 2,
            area: ['80%', '80%'],
            scrollbar: false,//屏蔽浏览器滚动条
            shade: 0.4,
            title: '查看方案',
            content: src + '?order_id=' + id
        });
    });
    /**
     * 查看施工进度
     */
    $('.page-container').on('click', '.tupian', function () {
        var winWidth = $(window).width();
        var areaWidth = "";
        var areaHeight = "";
        if (winWidth > 768) {
            areaWidth = "800px"
            areaHeight = "600px"
        } else {
            areaWidth = '90%'
            areaHeight = '95%'
        }
        var id = $(this).attr('data-id');
        var src = "{:Url('index/order/jin')}";
        layer.open({
            type: 2,
            area: [areaWidth, areaHeight],
            scrollbar: true,//屏蔽浏览器滚动条
            shade: 0.4,
            title: '查看进度',
            content: src + '?order_id=' + id
        });
    });

    /**
     * 基建
     */
    $('.page-container').on('click', '.del1', function () {
        var capital_id = $(this).attr('data-id');
        var key = $(this).attr('key');
        var count = $(this).attr('count');
        var src = "{:Url('index/order/del1')}";
        var ss = 0;
        if (count != 1 && key == 1) {
            ss = 1;
        }
        layer.confirm('确认要删除该基检么？', function (index) {
            $.ajax({
                type: 'POST',
                url: src,
                dataType: 'json',
                data: {
                    capital_id: capital_id,
                    key: ss,

                },
                success: function (data) {
                    var res = JSON.parse(data);
                    if (res.code == 200) {
                        layer.msg(res.msg, {icon: 1, time: 2000}, function (index, layero) {
                            setTimeout("window.parent.location.reload()", 1);

                        });
                    } else {
                        layer.msg(res.msg, {icon: 5, time: 1000});
                    }

                },
                error: function (data) {
                    console.log(data.msg);
                },
            });
        });
    });

</script>
</body>
</html>
